141e26c9cc14a06d32fd8a0dcd20e805c984de74,openmeetings-webservice/src/main/java/org/apache/openmeetings/webservice/util/AppointmentParamConverter.java,AppointmentParamConverter,fromString,#String#,37
Before Change
public AppointmentDTO fromString(String val) {
JSONObject o = new JSONObject(val);
AppointmentDTO a = new AppointmentDTO();
long id = o.optLong("id");
a.setId(id == 0 ? null : id);
a.setTitle(o.optString("title"));
a.setLocation(o.optString("location"));
a.setOwner(UserDTO.get(o.optJSONObject("owner")));
After Change
public class AppointmentParamConverter implements ParamConverter<AppointmentDTO> {
@Override
public AppointmentDTO fromString(String val) {
JSONObject o = new JSONObject(val);
AppointmentDTO a = new AppointmentDTO();
a.setId(optLong(o, "id"));
a.setTitle(o.optString("title"));
a.setLocation(o.optString("location"));
a.setOwner(UserDTO.get(o.optJSONObject("owner")));
String tzId = a.getOwner() == null ? null : a.getOwner().getTimeZoneId();
a.setStart(CalendarParamConverter.get(o.optString("start"), tzId));
a.setEnd(CalendarParamConverter.get(o.optString("end"), tzId));
a.setDescription(o.optString("description"));
a.setInserted(DateParamConverter.get(o.optString("inserted")));
a.setUpdated(DateParamConverter.get(o.optString("updated")));
a.setDeleted(o.optBoolean("inserted"));
a.setReminder(optEnum(Reminder.class, o, "reminder"));
a.setRoom(RoomDTO.get(o.optJSONObject("room")));
a.setIcalId(o.optString("icalId"));
JSONArray mm = o.optJSONArray("meetingMembers");